-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand scf dialect implementation #38
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. Some questions.
tests/test_scf.py
Outdated
if len(sys.argv) > 1: | ||
exec(sys.argv[1]) | ||
else: | ||
from pytest import main | ||
main([__file__]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(sys.argv) > 1: | |
exec(sys.argv[1]) | |
else: | |
from pytest import main | |
main([__file__]) | |
from pytest import main | |
main([__file__]) |
Please don't add exec
calls into the code (even if it's a main function of a test file). Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied this from test_linalg.py, so I'll make the change there too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And test_builder.py
mlir/dialects/func.py
Outdated
@@ -23,7 +23,7 @@ class CallIndirectOperation(DialectOp): | |||
@dataclass | |||
class CallOperation(DialectOp): | |||
func: mast.SymbolRefId | |||
type: mast.FunctionType | |||
type: Optional[mast.FunctionType] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there not be an accompanying lark change for this? Also, why would calls not have type information? Is that a new addition to MLIR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was probably a copy-paste problem with argtypes being a duplicate of type. It should just be using type in both syntaxes.
Will clean up the unused argtypes in CallIndirectOperation too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now, thanks
condition
,while
andyield
opsif
for
,if
andwhile
using examples from https://mlir.llvm.org/docs/Dialects/SCFDialect/for
roundtrip)